/*
语法百题 解题报告：
 http://git.oschina.net/et0662/sznoi-grammar/ 
*/
#include<stdio.h>

int main(void)
{
	int a=0,b=0,c=0;
	char t;
	while( (t=getchar())!='?')
	{
		if(('0'<=t) && (t<='9'))
			b++;
		else if ((('A'<=t) && (t<='Z')) || (('a'<=t) && (t<='z'))){
			a++;
		}else{
			c++;
		}
	}
	printf("%d\n",a);
	printf("%d\n",b);
	printf("%d\n",c);
	return 0;
}
